/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hu.elte.progelm2.ejb.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author ntb
 */
@Entity
@Table(name = "treetypes")
@NamedQueries({
    @NamedQuery(name = "Treetypes.findAll", query = "SELECT t FROM Treetypes t"),
    @NamedQuery(name = "Treetypes.findById", query = "SELECT t FROM Treetypes t WHERE t.id = :id"),
    @NamedQuery(name = "Treetypes.findByName", query = "SELECT t FROM Treetypes t WHERE t.name = :name"),
    @NamedQuery(name = "Treetypes.findByImage", query = "SELECT t FROM Treetypes t WHERE t.image = :image"),
    @NamedQuery(name = "Treetypes.findByDescription", query = "SELECT t FROM Treetypes t WHERE t.description = :description")})
public class Treetypes implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @javax.persistence.SequenceGenerator(name = "treetype_seq",
    sequenceName = "treetype_seq")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "treetype_seq")
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Column(name = "image")
    private String image;
    @Column(name = "description")
    private String description;
    @JoinColumn(name = "forrestid", referencedColumnName = "id")
    @ManyToOne
    private Forrest forrestid;

    public Treetypes() {
    }

    public Treetypes(Integer id) {
        this.id = id;
    }

    public Treetypes(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Forrest getForrestid() {
        return forrestid;
    }

    public void setForrestid(Forrest forrestid) {
        this.forrestid = forrestid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Treetypes)) {
            return false;
        }
        Treetypes other = (Treetypes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "hu.elte.progelm2.ejb.entity.Treetypes[id=" + id + "]";
    }
}
